package com.jiutianniao.p2p.acctrans.core.exception;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.jiutianniao.p2p.trans.client.enums.TransResultEnum;

/**
 * 账务交易异常类
 * 
 */
public class TransException extends RuntimeException {

	private static final long serialVersionUID = 2104944641926889321L;

	private TransResultEnum code = null;

	public TransException(TransResultEnum code) {
		super();
		this.code = code;
	}

	public TransException(TransResultEnum code, Throwable e) {
		super(e);
		this.code = code;
	}

	public TransResultEnum getCode() {
		return code;
	}

	public void setCode(TransResultEnum code) {
		this.code = code;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.SHORT_PREFIX_STYLE);
	}
}